{include file="header.html"}
<div class="page-header">
	<h6>
		<a href="?app=service&act=province">参保省市</a>
		<small>
			<i class="ace-icon fa fa-angle-double-right"></i>
			<a href="?app=service&act=city&province_id={$province_id}">参保城市</a>
			<i class="ace-icon fa fa-angle-double-right"></i>
			{$city_name}
			<i class="ace-icon fa fa-angle-double-right"></i>
			明细表
		</small>
	</h6>
</div>
<div class="row">
<div class="col-xs-12">
	<form class="form-horizontal" role="form" method="post" action="?app=service&act=casy_detail" enctype="multipart/form-data">
		<input type="hidden" name="casy_id" id="casy_id" value="{$casy_id}" />
		<input type="hidden" name="service_city_id" id="service_city_id" value="{$service_city_id}" />
		<input type="hidden" name="province_id" id="province_id" value="{$province_id}" />
		
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="casy"><span class="btn-info btn-add" id="add">+</span> 明细表 </label>
			<div class="col-sm-10">
				<table id="simple-table" class="col-table">
					<thead>
						<tr>
							<th>名称：</th>
							<th>最低基数：</th>
							<th>企业缴纳百分比：</th>
							<th>个人缴纳百分比：</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody id="addTr">
						{if is_array($rs)}
						{foreach from=$rs item=g key=k}
						<tr align="center">
							<td><input type="text" name="name[]" value="{$g->name}" /></td>
							<td><input type="text" name="money[]" value="{$g->money}" /></td>
							<td><input type="text" name="firm[]" value="{$g->firm}" /></td>
							<td><input type="text" name="person[]" value="{$g->person}" /></td>
							<td>{if $k>0}<a href="javascript:void(0)" onclick="deleteSelf(this)">删除</a>{else}-{/if}</td>
						</tr>
						{/foreach}
						{else}
						<tr align="center">
							<td><input type="text" name="name[]" value="" /></td>
							<td><input type="text" name="money[]" value="" /></td>
							<td><input type="text" name="firm[]" value="" /></td>
							<td><input type="text" name="person[]" value="" /></td>
							<td>-</td>
						</tr>
						{/if}
					<tbody>
				</table>
			</div>
		</div>

		<div class="clearfix form-actions">
			<div class="col-md-offset-3 col-md-9">
				<button class="btn btn-info" type="submit">
					<i class="ace-icon fa fa-check bigger-110"></i>
					提交
				</button>

				&nbsp; &nbsp; &nbsp;
				<button class="btn" type="reset">
					<i class="ace-icon fa fa-undo bigger-110"></i>
					重置
				</button>
			</div>
		</div>
	</form>
</div>
</div>
<script>
function deleteSelf(k){
	$(k).parent().parent().remove();
}
$(function(){
	$('#add').click(function(){
		var html = '<tr align="center">\
			<td><input type="text" name="name[]" value="" /></td>\
			<td><input type="text" name="money[]" value="" /></td>\
			<td><input type="text" name="firm[]" value="" /></td>\
			<td><input type="text" name="person[]" value="" /></td>\
			<td><a href="javascript:void(0)" onclick="deleteSelf(this)">删除</a></td>\
		</tr>';
		$('#addTr').append(html);
	});
});
</script>
{include file="footer.html"}